package com.mju.feign.clients;


import com.mju.controller.common.JsonResult;
import com.mju.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient("user-service")
public interface UserClient {
    @GetMapping("/users/getUser/{uid}")
    JsonResult<User> getById(@PathVariable("uid") Integer uid);

    //修改用户状态
    @PutMapping("/users/updateStatus")
    public JsonResult updateStatus(@RequestParam("uid") Integer uid,@RequestParam("status")  Integer status);

    //修改用户是否为VIP和会员名称
    @PutMapping("/users/updateIsVipAndVipName")
    public JsonResult<String> updateIsVipAndVipName(
            @RequestParam("uid") Integer uid, @RequestParam("status") Integer status, @RequestParam("vipName") String vipName);

    //修改用户是否为VIP
    @PutMapping("/users/updateIsVip" )
    public JsonResult<String > updateIsVip(
            @RequestParam("uid")Integer uid,@RequestParam("status")Integer status);

    // 获取用户的uid
    @GetMapping("/users/getUidByUname/{uname}")
    public JsonResult<Integer> getUidByUname(@PathVariable("uname") String uname);
}